use axum::{middleware::from_extractor, routing::get, Router};

use crate::middleware::auth::Auth;

pub(crate) fn group_test() -> Router {
    Router::new()
        .route("/", get(crate::controller::home::index))
        .route(
            "/:user_id/profile/:name",
            get(crate::controller::home::index),
        )
}

pub(crate) fn group_user() -> Router {
    Router::new()
        .route(
            "/",
            get(crate::controller::user::list).post(crate::controller::user::create),
        )
        .route(
            "/:user_id",
            get(crate::controller::user::find).delete(crate::controller::user::delete),
        )
        .layer(from_extractor::<Auth>())
}

#[allow(dead_code)]
pub(crate) fn group_system() -> Option<Router> {
    None
}